package
{
	import controllers.MessageController;
	
	import flash.external.ExternalInterface;
	import flash.utils.getDefinitionByName;
	
	import org.dexter.sendDexterEvent;
	public class MessageCtrl extends MessageController
	{
		public function MessageCtrl()
		{
			super();
		}
		[DexterEvent]
		public function callJs(...arg):void{
			arg[0] = '$'+arg[0];
			try{
				ExternalInterface.call.apply(null,arg);
			}catch(e:Error){
			}
		}
		[DexterEvent]
		public function $callJs(...arg):void{
			arg[0] = '$'+arg[0];
			try{
				ExternalInterface.call.apply(null,arg);
			}catch(e:Error){
			}
		}
		[DexterExternal]
		public function localSettingError(name:String,value:*):void{
			sendDexterEvent("callJs","jsTrace",name,value);
		}
		[DexterExternal]
		public function callStaticFunction(c:String,f:String,arg:Array):*{
			return getDefinitionByName(c)[f].apply(null,arg);
		}
		[DexterExternal]
		public function getStaticProperty(c:String,name:String):*{
			return getDefinitionByName(c)[name];
		}
	}
}